using System;

namespace Tarkin.InfrastructureLibrary.Core.Basic
{
    /// <summary>
    /// The TypedElement class is the implementation of the TypedElement abstract class as defined by 
    /// section 10.1.5 of the Unified Modeling Language: Infrastructure specfication (version 2.1.1,
    /// dated 07-02-06).
    /// </summary>
    /// <remarks>Tarkin classes are NOT thread-safe.</remarks>
    public abstract class TypedElement : NamedElement
    {

#region Private Members

        /// <summary>
        /// The Type of the TypedElement.
        /// </summary>
        private Type type = null;

#endregion


#region Constructors

        /// <summary>
        /// Default constructor.
        /// </summary>
        public TypedElement () : base ()
        { }

        /// <summary>
        /// Overloaded constructor.
        /// </summary>
        /// <param name="name">Name of the TypedElement.</param>
        public TypedElement ( string name ): base ( name )
        { }

        /// <summary>
        /// Overloaded constructor.
        /// </summary>
        /// <param name="type">The Type of the TypedElement.</param>
        public TypedElement ( Type type )
        {
            Type = type;
        }

        /// <summary>
        /// Overloaded constructor.
        /// </summary>
        /// <param name="name">The name of the TypedElement.</param>
        /// <param name="type">The Type of the TypedElement.</param>
        public TypedElement ( string name, Type type ): base ( name )
        {
            Type = type;
        }


#endregion


#region Public Properties

        /// <summary>
        /// The Type of the TypedElement.
        /// </summary>
        public Type Type
        {
            get
            {
                return type;
            }

            set
            {
                type = value;
            }
        }

#endregion

    }
}
